﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AncientEmpires_025_132
{
    public class GameSettingSetup
    {
        public enum TypeUpdate
        {
            UpdateScreenResolution,
            UpdateFullScreen,
            UpdateMouseSpeed,
            UpdateMusicVolume,
            UpdateVoiceVolume
        }
        public enum Navigate
        {
            Next,
            Back
        }

        private ScreenResolution _screenResolution;

        public ScreenResolution ScreenResolution
        {
            get { return _screenResolution; }
            set { _screenResolution = value; }
        }

        private bool _isFullScreen;

        public bool IsFullScreen
        {
            get { return _isFullScreen; }
            set { _isFullScreen = value; }
        }

        private MouseSpeed _mouseSpeed;

        public MouseSpeed MouseSpeed
        {
            get { return _mouseSpeed; }
            set { _mouseSpeed = value; }
        }

        private VoiceVolume _voiceVolume;

        public VoiceVolume VoiceVolume
        {
            get { return _voiceVolume; }
            set { _voiceVolume = value; }
        }

        private MusicVolume _musicVolume;

        public MusicVolume MusicVolume
        {
            get { return _musicVolume; }
            set { _musicVolume = value; }
        }

        public GameSettingSetup()
        {
            ScreenResolution = ScreenResolution.sr1024x600;
            IsFullScreen = false;
            MouseSpeed = MouseSpeed.Medium;
            MusicVolume = MusicVolume.Medium;
            VoiceVolume = VoiceVolume.Medium;
        }

        public void Update(TypeUpdate typeUpdate, Navigate nav)
        {
            switch (typeUpdate)
            {
                case TypeUpdate.UpdateScreenResolution:
                    switch (ScreenResolution)
                    { 
                        case ScreenResolution.sr1024x600:
                            if (nav == Navigate.Next) ScreenResolution = ScreenResolution.sr1366x768;
                            else ScreenResolution = ScreenResolution.sr800x600;
                            break;
                        case ScreenResolution.sr1366x768:
                            if (nav == Navigate.Next) ScreenResolution = ScreenResolution.sr800x600;
                            else ScreenResolution = ScreenResolution.sr1024x600;
                            break;
                        case ScreenResolution.sr800x600:
                            if (nav == Navigate.Next) ScreenResolution = ScreenResolution.sr1024x600;
                            else ScreenResolution = ScreenResolution.sr1366x768;
                            break;
                    }
                    break;
                case TypeUpdate.UpdateFullScreen:
                    IsFullScreen = !IsFullScreen;
                    break;
                case TypeUpdate.UpdateMouseSpeed:
                    switch (MouseSpeed)
                    { 
                        case MouseSpeed.Low:
                            if (nav == Navigate.Next) MouseSpeed = MouseSpeed.Medium;
                            else MouseSpeed = MouseSpeed.High;
                            break;
                        case MouseSpeed.Medium:
                            if (nav == Navigate.Next) MouseSpeed = MouseSpeed.High;
                            else MouseSpeed = MouseSpeed.Low;
                            break;
                        case MouseSpeed.High:
                            if (nav == Navigate.Next) MouseSpeed = MouseSpeed.Low;
                            else MouseSpeed = MouseSpeed.Medium;
                            break;
                    }
                    break;
                case TypeUpdate.UpdateMusicVolume:
                    switch (MusicVolume)
                    {
                        case MusicVolume.Low:
                            if (nav == Navigate.Next) MusicVolume = MusicVolume.Medium;
                            else MusicVolume = MusicVolume.High;
                            break;
                        case MusicVolume.Medium:
                            if (nav == Navigate.Next) MusicVolume = MusicVolume.High;
                            else MusicVolume = MusicVolume.Low;
                            break;
                        case MusicVolume.High:
                            if (nav == Navigate.Next) MusicVolume = MusicVolume.Low;
                            else MusicVolume = MusicVolume.Medium;
                            break;
                    }
                    break;
                case TypeUpdate.UpdateVoiceVolume:
                    switch (VoiceVolume)
                    {
                        case VoiceVolume.Low:
                            if (nav == Navigate.Next) VoiceVolume = VoiceVolume.Medium;
                            else VoiceVolume = VoiceVolume.High;
                            break;
                        case VoiceVolume.Medium:
                            if (nav == Navigate.Next) VoiceVolume = VoiceVolume.High;
                            else VoiceVolume = VoiceVolume.Low;
                            break;
                        case VoiceVolume.High:
                            if (nav == Navigate.Next) VoiceVolume = VoiceVolume.Low;
                            else VoiceVolume = VoiceVolume.Medium;
                            break;
                    }
                    break;
            }
        }
    }
}
